<%--
  Created by IntelliJ IDEA.
  User: rhc
  Date: 2018/9/3 0003
  Time: 上午 10:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String date = format.format(new Date());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <%--<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">--%>
    <%--<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">--%>
    <link href="<%=path%>/CSS/print.css" rel="stylesheet" media="print">
    <title>Title</title>
</head>
<style>
    .w3cbbs { page-break-after:always;}
    @page {
        size: A4;
        margin: 0;
    }
    @media print {
        .page {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: always;
        }

        .w3cbbs { page-break-after:always;}
        body {
            margin: 0;
            padding: 0;
            background-color: #FAFAFA;
            font: 12pt "Tahoma";
            text-align: center;
        }
        * {
            box-sizing: border-box;
            -moz-box-sizing: border-box;
        }

        .page {
            width: 21cm;
            height: 29.7cm;

            margin: 0 auto;
            border: 1px #D3D3D3 solid;
            border-radius: 5px;
            background: white;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
        }
        .subpage {

            border: 1px  solid #ffffff;
            height: 100%;

        }

    }


</style>
<style>
    #head {
        text-align: center;
        line-height: 40px;
        font-size: 28px;
        font-weight: bold;
    }
    .text1 table {
        width: 100%;
        border: 1px solid #ffffff;
        border-collapse: collapse; /*细线表格代码*/
        text-align: center;
    }
    .text2 span {
        line-height: 60px;
        margin-left: 60%;
    }
    .text1 table:nth-child(2) {
        border-top: none;
    }

   .text1 table:nth-child(2) tr td {
        border-top: none;
    }
    .text1 table tr td {
        border: 1px solid #000000; /*细线表格线条颜色*/
        height: 40px;
        font-size: 18px;
        color: #000000;
    }
    .botton span {
        width: 80px;
    }

    .botton input {
        width: 230px;
    }

    span input {
        width: 120px;
    }
</style>
<body>
<div>
  <span style="cursor:pointer; padding-left: 40px;color: #a9bbe0;font-size: 14px"
        class="printTable" onclick="print()">打印所有</span>
</div>
<div>
    <input type="button" class="input_back fh" value="关闭" style="display: block;background-color: #0b93d5;color:white;width: 150px;height: 50px;"
           onclick="back()"/>
</div>
<br/>
    <div class="book">
        <c:forEach items="${CarmaintainList}" var="CarmaintainList" varStatus="s">
        <div class="page w3cbbs">
            <div class="subpage">
                <div id="head" style="text-align: center; line-height: 40px;font-size: 28px;font-weight: bold;">
                    <span>${CarmaintainList.carmaintainentryList[0].cfrepairshopName}</span>
                    <br/>
                    <span>结 算 单</span>
                </div>
                <div class="text1" style="">
                    <table style="width: 100%;border: 1px solid #000000;border-collapse: collapse; /*细线表格代码*/text-align: center;">
                        <tr>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">车号</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${CarmaintainList.cfcarName}</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">车型</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${CarmaintainList.carName}</td>
                        </tr>
                        <tr>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">业务日期</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${CarmaintainList.fbizdate}</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">出厂时间</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                        </tr>
                    </table>
                    <table style="width: 100%;border: 1px solid #000000;border-collapse: collapse; /*细线表格代码*/text-align: center;">
                        <tr>
                            <td colspan="2"style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">维修项目</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">材料数量</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">材料单价</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">材料金额</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">工时数量</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">工时单价</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">工时金额</td>
                            <td style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">小计</td>
                        </tr>
                        <c:forEach items="${CarmaintainList.carmaintainentryList}" var="carmaintainentry"
                                   varStatus="s">
                            <tr>
                                <td colspan="2" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfmaintainitemName}</td>
                                <td class="dy_cfqty${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfqty}</td>
                                <td class="dy_cfprice${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfprice}</td>
                                <td class="dy_cfamount${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfamount}</td>
                                <td class="dy_cfgsqty${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfgsqty}</td>
                                <td class="dy_cfmanhours${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfmanhours}</td>
                                <td class="dy_cfbasemanhours${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfbasemanhours}</td>
                                <td class="dy_cfallamount${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">${carmaintainentry.cfallamount}</td>
                            </tr>
                        </c:forEach>
                        <tr>
                            <td colspan="2"style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;">合计</td>
                            <td id="no_dy_cfqty${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                            <td id="no_dy_cfprice${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                            <td id="dy_cfamount${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                            <td id="no_dy_cfgsqty${CarmaintainList.sum}" style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                            <td id="no_dy_cfmanhours${CarmaintainList.sum}"style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                            <td id="dy_cfbasemanhours${CarmaintainList.sum}"style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                            <td id="dy_cfallamount${CarmaintainList.sum}"style=" border: 1px solid #000000; /*细线表格线条颜色*/height: 40px;font-size: 18px;color: #000000;"></td>
                        </tr>
                    </table>
                </div>
                <div class="text2" style="line-height: 60px;margin-left: 60%;">
                    <span>客户签名：</span>
                </div>
            </div>
        </div>
        </c:forEach>
    </div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
    <script language="javascript" src="<%=path%>/JQuery/jquery-1.4.4.min.js"></script>
    <script language="javascript" src="<%=path%>/JQuery/jquery.jqprint-0.3.js"></script>
    <script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript" src="<%=path%>/JS/tempJs/tool.js"></script>
<script>
    /*计算打印的内容*/
    $(document).ready(function () {
//        $('#dy_cfqty').text(class_sum('.dy_cfqty'));
//        $('#dy_cfprice').text(class_sum('.dy_cfprice'));
//        $('#dy_cfamount').text(class_sum('.dy_cfamount'));
//        $('#dy_cfgsqty').text(class_sum('.dy_cfgsqty'));
//        $('#dy_cfmanhours').text(class_sum('.dy_cfmanhours'));
//        $('#dy_cfbasemanhours').text(class_sum('.dy_cfbasemanhours'));
//        $('#dy_cfallamount').text(class_sum('.dy_cfallamount'));
      var size=${count};
        for (var i=0;i<size;i++){
            $('#dy_cfqty'+i).text(class_sum('.dy_cfqty'+i));
            $('#dy_cfprice'+i).text(class_sum('.dy_cfprice'+i));
            $('#dy_cfamount'+i).text(class_sum('.dy_cfamount'+i));
            $('#dy_cfgsqty'+i).text(class_sum('.dy_cfgsqty'+i));
            $('#dy_cfmanhours'+i).text(class_sum('.dy_cfmanhours'+i));
            $('#dy_cfbasemanhours'+i).text(class_sum('.dy_cfbasemanhours'+i));
            $('#dy_cfallamount'+i).text(class_sum('.dy_cfallamount'+i));
        }

    });
    function back()
    {
        location = '<%=path%>/DrivingSys/queryCarmaintain/look.action';
    }
    function print(){
        $(".book").jqprint({debug: true,importCSS: true, printContainer: true, operaSupport: true});
    }
</script>
</html>
